package com.lhkj.ct.base.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * 操作人类别
 *
 *
 */
public enum OperatorType implements IBaseEnum<Integer, String> {
    /**
     * 其它
     */
    OTHER(0, "其他"),

    /**
     * 后台用户
     */
    MANAGE(1, "后台用户"),

    /**
     * 手机端用户
     */
    USER(2, "平台用户"),

    /**
     * 手机端用户
     */
    MOBILE(3, "移动端用户");

    @EnumValue
    private int code;

    private String description;

    public String getDescription() {
        return description;
    }

    OperatorType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static ActionType getTarget(String value) {
        ActionType[] actionTypes = ActionType.values();
        ActionType target = null;
        for (ActionType actionType : actionTypes) {
            if (value.equals(actionType.getLabel())) {
                target = actionType;
                break;
            }
        }
        return target;
    }

    public int getCode() {
        return code;
    }

    @Override
    public Integer getValue() {
        return code;
    }

    @Override
    public String getLabel() {
        return description;
    }


    @Override
    public String toString() {
        return code +":"+description;
    }
}
